package com.zhijian.medical.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 产品流转状态枚举类
 *
 * @author HCG
 * @version 1.0
 * @date 2022/2/7
 */
@AllArgsConstructor
@Getter
public enum ProductTurnStatusEnum {

    SHEN_QING(0, "申请库存中，试剂管理员待审批"),
//    SHEBEISHIJIGUANLIYUAN_APPROVED(1, "试剂管理员审批通过，亚专科主任待审批"),
    //    YAZHUANKEZHUREN_APPROVED(2, "亚专科主任审批通过，行政主任待审批"),
    APPROVED(3, "审批完成，待发货"),
    SEND_OUT(4, "发货中"),
    HARVEST(5, "已完成"),
    CANCEL(99, "已取消");

    private Integer code;
    private String desc;

    public static ProductTurnStatusEnum getByCode(Integer code) {
        ProductTurnStatusEnum[] productTurnStatusEnums = ProductTurnStatusEnum.values();
        for (ProductTurnStatusEnum productTurnStatusEnum : productTurnStatusEnums) {
            if (productTurnStatusEnum.getCode().equals(code)) {
                return productTurnStatusEnum;
            }
        }
        return null;
    }
}
